from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager

ChromeIns=ChromeDriverManager().install()
driver=webdriver.Chrome(service=Service(ChromeIns))

#find_elements查找多个元素
driver.get("https://www.baidu.com/")
ret = driver.find_elements(By.CSS_SELECTOR, "#hotsearch-content-wrapper > li:nth-child(5) > a") #列表ret中就存在多个元素

for i in ret:
    print(i.text) #获取每个元素对应的文本信息

driver.quit()

# 查找元素的方式：
# id, xpath, classname, css-selector, tag-name
#cssselector：选择页面中指定的标签元素，